//
//  KRFindListModel.m
//  KEREN
//
//  Created by MW on 2023/4/25.
//

#import "KRFindListModel.h"

@implementation KRFindListModel
+ (instancetype)initWithDictionary:(NSDictionary *)jsonDic{
    KRFindListModel *model = [[super alloc] init];
    [model setValuesForKeysWithDictionary:jsonDic];
    if(model.head_img){
        if(![model.head_img hasPrefix:@"http"]){
            model.head_img = [NSString stringWithFormat:@"%@%@",BaseimageUrl,model.head_img];
        }
        model.head_img = [model.head_img stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    }
    if(model.url){
        if(![model.url hasPrefix:@"http"]){
            model.url = [NSString stringWithFormat:@"%@%@",BaseimageUrl,model.url];
        }
        model.url = [model.url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    }
    return model;
}
-(id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if([key isEqualToString:@"id"]){
        self.Id  = [value intValue];
    }
    if([key isEqualToString:@"ID"]){
        self.Id  = [value intValue];
    }

    
}

@end
